﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PmsClient
{
    public class PageControls
    {
        public static void button_enable_true(System.Web.UI.UpdatePanel a)
        {
            foreach (var c in a.ContentTemplateContainer.Controls)
            {
                if (c is Button)
                {
                    ((Button)(c)).Enabled = true;
                }
            }
        }

        public static void button_enable_false(System.Web.UI.UpdatePanel a)
        {
            foreach (var c in a.ContentTemplateContainer.Controls)
            {
                if (c is Button)
                {
                    ((Button)(c)).Enabled = false;
                }
            }
        }

        public static void textbox_readonly_true(System.Web.UI.UpdatePanel a)
        {

            foreach (var c in a.ContentTemplateContainer.Controls)
            {
                if (c is TextBox)
                {
                    ((TextBox)(c)).ReadOnly = true;
                }
            }
        }

        public static void textbox_readonly_false(System.Web.UI.UpdatePanel a)
        {

            foreach (var c in a.ContentTemplateContainer.Controls)
            {
                if (c is TextBox)
                {
                    ((TextBox)(c)).ReadOnly = false;
                }
            }
        }

        public static void textbox_nvl(System.Web.UI.UpdatePanel a)
        {

            foreach (var c in a.ContentTemplateContainer.Controls)
            {
                if (c is TextBox)
                {
                    ((TextBox)(c)).Text = "";
                }
            }
        }

    }

}
